package com.naiterui.ehp.bs.patient.bo.notice;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

import com.naiterui.ehp.bs.patient.config.TemplateProperties;

/**
 * 闹钟模板
 *
 * @author zhoupeipei
 * @date 2019-06-19 15:48
 * @since 1.0.0
 */
public class AlarmClock extends BaseNotice {
    private static final long serialVersionUID = 1146280485819789629L;

    /**
     * 医生姓名
     */
    private String doctorName;

    public AlarmClock(String openId, String doctorName) {
        super.setOpenId(openId);
        this.doctorName = doctorName;
    }

    public String getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    @Override
    public String getTemplateLabel() {
        return "ALARM_CLOCK";
    }

    @Override
    public void handleContent(List<TemplateProperties.Content> contentList) {
        Map<String, String> formatMap = new HashMap<>();
        formatMap.put("DOCTOR_NAME", getDoctorName());
        super.formatData(contentList,formatMap);
    }

    @Override
    public boolean validate() {
        if (StringUtils.isNotBlank(doctorName) && super.validate()) {
            return true;
        } else {
            return false;
        }
    }
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
